<template>
  <div class="son">
    <h3>子组件</h3>
    <div>父亲传来的值：{{ value }}</div>
    <button @click="sendData(sendValue)">传值给父亲</button>
    <Grandson v-bind="$attrs" />
  </div>
</template>

<script lang="ts" setup>
import Grandson from "../Grandson/index.vue";
import { ref, defineProps } from "vue";

defineProps(["value", "sendData"]);
let sendValue = ref("我是你儿子");
</script>

<style lang="less" scoped>
.son {
  height: 500px;
  padding: 20px;
  margin: 10px 0;
  background-color: skyblue;
  border-radius: 10px;
  box-shadow: 0 0 10px;
}
</style>
